#include "TripleList.h"


// 构造
CTripleList::CTripleList()
{
    this->header = NULL;
    this->tail = NULL;
}

// 添加元素
void CTripleList::push(Triple *triple)
{
    if (this->tail == NULL)
    {
        this->header = triple;
        this->tail = triple;
    }
    else
        this->tail->next = triple;
}

// 拉取元素
CTripleList::Triple* CTripleList::pull()
{
    Triple* result = this->header;

    if (this->header != NULL)
        this->header = this->header->next;

    return result;
}
